package com.huluobo.a2303mdmdemo.goods

import com.huluobo.a2303mdmdemo.goods.entity.CartEntity
import com.huluobo.a2303mdmdemo.goods.entity.GoodsEntity
import com.huluobo.lib_base.Res
import com.huluobo.lib_http.Const
import kotlinx.coroutines.flow.Flow
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

/**
 *  Created by LC on 2025/9/3.
 */
interface ApiService {
    @GET(Const.URL_GET_ALL_GOODS)
    fun getAllGoods(
        @Query(Const.PARAM_CATEGORY_ID) categoryId: Int,
        @Query(Const.PARAM_CURRENT_PAGE) currentPage: Int,
        @Query(Const.PARAM_PAGE_SIZE) pageSize: Int
    ): Flow<Res<GoodsEntity>>

    @POST(Const.URL_ADD_TO_CART)
    fun addToCart(@Body body: RequestBody): Flow<Res<Any>>

    @GET(Const.URL_GET_CART)
    fun getCart(): Flow<Res<CartEntity>>
}